package com.example.builder;

/**
 * Created by Risky57 on 2017/4/28.
 */

public class Computer {

    private String display;
    private String cpu;
    private String mainBoard;
    private String keyboard;
    private String mouse;

    public Computer (String display, String cpu, String mainBoard, String keyboard, String mouse) {
        this.display = display;
        this.cpu = cpu;
        this.mainBoard = mainBoard;
        this.keyboard = keyboard;
        this.mouse = mouse;
    }

    public static class Builder{
        private String display = "小米";
        private String cpu;
        private String mainBoard;
        private String keyboard;
        private String mouse;

        public Builder setDisplay (String display) {
            this.display = display;
            return this;
        }

        public Builder setCpu (String cpu) {
            this.cpu = cpu;
            return this;
        }

        public Builder setMainBoard (String mainBoard) {
            this.mainBoard = mainBoard;
            return this;
        }

        public Builder setKeyboard (String keyboard) {
            this.keyboard = keyboard;
            return this;
        }

        public Builder setMouse (String mouse) {
            this.mouse = mouse;
            return this;
        }

        public Computer build(){
            return new Computer(display, cpu, mainBoard, keyboard, mouse);
        }

    }

}
